<template>
  <div style="padding: 5px">
    <el-header>
      <div>
        <div style="display: inline-block;">
          <el-button icon="el-icon-back" size="small" style="font-family: Microsoft YaHei" type="text"
                     @click="goBack">返回
          </el-button>
        </div>
        <div style="display: inline-block">|</div>
        <div style="display: inline-block;">
          <div style="padding-bottom: 15px;margin-left:10px">
            <span style="font-family: Microsoft YaHei;display: inline-block; font-size: 14px;">术语详情</span>
          </div>
        </div>
        <div style="border-bottom: solid 1px #C9C9C9"></div>
      </div>
    </el-header>
    <el-container>
      <el-main>
        <div style="overflow: auto;">
          <el-row>
            <el-col :span="24">
              <el-row align="middle" type="flex">
                <el-col :span="2">术语正名:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入英文名称" :content.sync="termDetailData.name" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">英文名称:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入英文名称" :content.sync="termDetailData.englishName" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">英文简称:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入英文简称" :content.sync="termDetailData.englishAbbr"
                              editor-type="Input" width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">俄文:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入俄文" :content.sync="termDetailData.russianName" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">法文:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入法文" :content.sync="termDetailData.frenchName" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">日文:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入日文" :content.sync="termDetailData.japaneseName" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex">
                <el-col :span="2">德文:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入德文" :content.sync="termDetailData.germanName" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex" v-for="(term, index) in termDetailData.termList" :key="index">
                <el-col :span="2" v-if="term.type === 1">正名1:</el-col>
                <el-col :span="2" v-if="term.type === 2">正名2:</el-col>
                <el-col :span="2" v-if="term.type === 3">又称:</el-col>
                <el-col :span="2" v-if="term.type === 4">曾称:</el-col>
                <el-col :span="2" v-if="term.type === 5">旧称:</el-col>
                <el-col :span="2" v-if="term.type === 6">通称:</el-col>
                <el-col :span="2" v-if="term.type === 7">简称:</el-col>
                <el-col :span="2" v-if="term.type === 8">全称:</el-col>
                <el-col :span="2" v-if="term.type === 9">正名3:</el-col>
                <el-col :span="22">
                  <el-row align="middle" type="flex">
                    <el-col :span="2" v-if="term.englishName">英文名称:</el-col>
                    <el-col :span="20">
                      <KindEditor placeholder="请输入英文名称" :content.sync="term.englishName" editor-type="Input"
                                  width="100%"/>
                    </el-col>
                  </el-row>
                  <el-row align="middle" type="flex">
                    <el-col :span="2" v-if="term.russianName">俄文:</el-col>
                    <el-col :span="20">
                      <KindEditor placeholder="请输入俄文" :content.sync="term.russianName" editor-type="Input"
                                  width="100%"/>
                    </el-col>
                  </el-row>
                  <el-row align="middle" type="flex">
                    <el-col :span="2" v-if="term.frenchName">法文:</el-col>
                    <el-col :span="20">
                      <KindEditor placeholder="请输入法文" :content.sync="term.frenchName" editor-type="Input"
                                  width="100%"/>
                    </el-col>
                  </el-row>
                  <el-row align="middle" type="flex">
                    <el-col :span="2" v-if="term.japaneseName">日文:</el-col>
                    <el-col :span="20">
                      <KindEditor placeholder="请输入日文" :content.sync="term.japaneseName" editor-type="Input"
                                  width="100%"/>
                    </el-col>
                  </el-row>
                  <el-row align="middle" type="flex">
                    <el-col :span="2" v-if="term.germanName">德文:</el-col>
                    <el-col :span="20">
                      <KindEditor placeholder="请输入德文" :content.sync="term.germanName" editor-type="Input"
                                  width="100%"/>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
              <el-row align="middle" type="flex" v-for="(termExplanation, index) in termDetailData.explanationList"
                      :key="index">
                <el-col :span="2">释义:</el-col>
                <el-col :span="22">
                  <KindEditor placeholder="请输入释义" :content.sync="termExplanation.explanation" editor-type="Input"
                              width="100%"/>
                </el-col>
              </el-row>
            </el-col>
          </el-row>
        </div>
      </el-main>
    </el-container>
  </div>
</template>
<script>
export default {
  name: "Detail",
  data() {
    return {
      termDetailData: {}
    }
  },
  methods: {
    goBack: function () {
      this.$router.push("/term/bookTermDetail");
    }
  },
  mounted() {
    this.axios.get('/pmph/action/term/selectDetailTermById', {
      params: {
        conceptId: this.$route.query.conceptId
      }
    }).then((response) => {
      this.termDetailData = response.data;
    }).catch((error) => {
      console.error(error);
      this.$message.error("未能请求到数据");
    })
  }
}
</script>

<style scoped>

</style>
